package gui;

import javax.swing.JFileChooser;
import javax.swing.JPanel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;

public class FileChooserPanel extends JPanel {

	JFileChooser fileChooser;
	private JLabel lblNewLabel;

	/**
	 * Create the panel.
	 */
	public FileChooserPanel() {
		setLayout(null);
		fileChooser = new JFileChooser();
		fileChooser.setBounds(10, 45, 681, 388);
		add(fileChooser);
		
		lblNewLabel = new JLabel("Select the file you want to load from");
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20));
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setBounds(10, 11, 700, 25);
		add(lblNewLabel);
		
		getFileChooser().setApproveButtonText("Load");
	}
	
	/**
	 * @return the fileChooser
	 */
	public JFileChooser getFileChooser() {
		return fileChooser;
	}

	public String getSelectedFilePath(){
		return fileChooser.getSelectedFile().getPath();
	}
}
